package com.srdl.code;

import com.srdl.code.generate_test.CodeGenerate;
import com.srdl.code.generate_test.config.DataSourceConfig;
import com.srdl.code.generate_test.config.GlobalConfig;

public class test {
    public static void main(String[] args) {
        DataSourceConfig dsc = new DataSourceConfig();//数据库配置
        dsc.setDatadase("account");//数据库名
        dsc.setDriverName("com.mysql.jdbc.Driver");
        dsc.setUrl("jdbc:mysql://127.0.0.1:3306/"+dsc.getDatabase()+"?characterEncoding=utf-8&serverTimezone=UTC");
//        dsc.setUrl("jdbc:mysql://42.192.141.46:3306/"+dsc.getDatabase()+"?characterEncoding=utf-8&serverTimezone=UTC");
        dsc.setUsername("root");
        dsc.setPassword("123456");

        GlobalConfig globalConfig=new GlobalConfig();
        globalConfig.setAuthor("srdl");//作者
        globalConfig.setProp("8080");//默认端口 8888 端口
        globalConfig.setType("ssm");//生成框架
        globalConfig.setTableNames(new String[]{"test2"});//表名生成实体,默认数据库所有表全部生成
        CodeGenerate codeGenerate = new CodeGenerate(globalConfig, dsc);
        codeGenerate.generateToFile();
    }
}
